﻿import { ButtonEnum, ITableConfig } from "@/components/table";

const tableConfig: ITableConfig = {
  buildInButtons: [
    {
      buttonKey: ButtonEnum.selectExcelExport,
      dataSource: "api/{{ModelClassName}}/SelectExportExcel",
    },
    {
      buttonKey: ButtonEnum.queryExcelExport,
      dataSource: "api/{{ModelClassName}}/QueryExportExcel",
    },
  ],
  columns: [
       {% for field in ModelFields %}
       {% if  field.DbColumnName contains 'Image' or field.DbColumnName contains 'image' or field.DbColumnName contains 'thumbnail'  or field.DbColumnName contains 'Thumbnail' %}
         {
            title: "{{field.ColumnDescription}}",
            key: "{{field.DbColumnName}}",
            dataIndex: "{{field.DbColumnName}}",
            slots: { customRender: "{{field.DbColumnName}}" },
            width: "5%",
        },{% else %}
          {
               title: "{{field.ColumnDescription}}",
               key: "{{field.DbColumnName}}",
               dataIndex: "{{field.DbColumnName}}",
          },
          {% endif %}
    {% endfor %}
      {
      title: "操作",
      dataIndex: "action",
      key: "action",
      align: "center",
      width: "18%",
      slots: { customRender: "action" },
    },
  ],
};

export default tableConfig;
